<?php
/*
//  Copyright (C) 2007 Max Plischke
//  Original Author: Max Plischke <plischke@gmail.com>
//  Link: http://code.google.com/p/open-club-directory/
// 
//  This file is part of the Open-Club-Directory Project.
//
//  Open-Club-Directory is free software: you can redistribute it and/or 
//  modify it under the terms of the GNU General Public License as published by
//  the Free Software Foundation, either version 3 of the License, or
//  (at your option) any later version.
//
//  Open-Club-Directory is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU General Public License for more details.
//
//  You should have received a copy of the GNU General Public License
//  along with Open-Club-Directory.
//  If not, see <http://www.gnu.org/licenses/>.
*/

require_once 'appinclude.php';
require_once 'funcinclude.php';

//========== vars

$selected_club_id=false;
$selected_country_id=false;
	
$club_selector=false;
$members=false;
$newest_members=false;
	
$my_club=false;


// main form
$form_country = $_REQUEST['country'];
$form_club = $_REQUEST['club'];
settype($form_country, "float");
settype($form_club, "float");

// event form
$form_ev_eventid = $_REQUEST['eventid'];
$form_ev_eventhosttype = $_REQUEST['eventhosttype'];
settype($form_ev_eventid, "float");
settype($form_ev_eventhosttype, "float");

//========== vars END

$link = mysql_connect($_mysql_server, $_mysql_user, $_mysql_password) or die();
mysql_select_db($_mysql_db) or die();

// main form - error handling
if ($form_club!=false) {
	$selected_country_id = country($form_club);
	if ($selected_country_id!=false) { 
		$selected_club_id = $form_club;
	}
} elseif ($form_country!=false && !$form_club) {
	$clubs_in_country = clubs('country', $form_country, 'extended', 'city');
	if ($clubs_in_country!=false) { 
		$selected_country_id = $form_country;
	}
} elseif (!$form_club && !$form_country) {
		
}

// member data -> personalize page (events, menu, etc)
// update profile
if ($is_app_added==true) { 
	$member = member($user);
	$facebook->api_client->profile_setFBML('', $user, profile($member), '', '');
} else { 
	$member=false; 
}

if ($member!=false) {
	// user timezone for events
	$user_timezone = $facebook->api_client->fql_query("SELECT timezone FROM user WHERE uid='$user'");
	// servers timezone= GMT-7 = now()
	// Vienna = GMT+1; Facebook = GMT
	// calc offset from server time: 7+($usertime) + now() 
	// create sql string: $timezone_GMToffset_sql;
	$timezone_GMToffset = (7+$user_timezone[0][timezone]);
	if (positive_number($timezone_GMToffset)==false) {
		$GLOBALS[timezone_GMToffset_sql] = 'DATE_SUB(NOW(),INTERVAL '.abs($timezone_GMToffset).' HOUR)';
	} else {
		$GLOBALS[timezone_GMToffset_sql] = 'DATE_ADD(NOW(),INTERVAL '.abs($timezone_GMToffset).' HOUR)';
	}
	
	
	// form handling - add event
	if (!empty($form_ev_eventid) && !empty($form_ev_eventhosttype)) {
		
		/* time offset problem -> fql doesn't allow date_add -> now() doesn't seem to be based on the users timzone either -> http://bugs.developers.facebook.com/show_bug.cgi?id=1535 */
		
		$addevent_arr = $facebook->api_client->fql_query("SELECT eid, start_time FROM event WHERE eid='$form_ev_eventid' AND start_time>now()");
		
		if (!empty($addevent_arr)) {
			$e_id = $addevent_arr[0][eid];
			
			if ($form_ev_eventhosttype==1) { 
				// club
				$host_id=$member[club_id];
			} elseif ($form_ev_eventhosttype==2 && $member[club_district]!=0) {
				// district
				$host_id=$member[club_district];
			} elseif ($form_ev_eventhosttype==3) {
				// country
				$host_id=$member[club_country];
			} else {
				echo '<fb:redirect url="'.$appcallbackurl.'">';
				exit;
			}
			
			$e_starttime = $addevent_arr[0][start_time];
			$query = "INSERT INTO events (e_id, host_type, host_id, fb_id, ts) VALUES ('$e_id', '$form_ev_eventhosttype', '$host_id', '$member[fb_id]', FROM_UNIXTIME($e_starttime))";
			$insert_event = mysql_query($query);
		}
	}
}

// generate page segments

if ($selected_club_id==false && $selected_country_id==false) {
	// main page -> country selector & newest global members
	
	$upcoming_events = events('personalized', $member['club_id'], $member['club_district'], $member['club_country']);
	$newest_members = members('all', '', 0, 10);
	
} elseif ($selected_country_id!=false && $selected_club_id==false) {
	// country page -> country selector & club selector & newest country members
	
	$club_selector=true;
	$upcoming_events = events('country', '', '', $selected_country_id);
	$newest_members = members('country', $selected_country_id, 0, 10);

} elseif ($selected_club_id!=false) {
	// club page -> country selector & club data & club members
	
	// my club ?
    if ($member!=false && $selected_club_id==$member['club_id']) {
    	$my_club=true;
    }
    
	$club_data = club($selected_club_id);
	$upcoming_events = events('club', $selected_club_id);
	$members = members('club', $selected_club_id);
}


// FBML Dashboard

echo '<fb:dashboard>';
echo '<fb:action href="'.$appcallbackurl.'">Home</fb:action>';
if (!empty($_url_map)) {
	echo '<fb:action href="'.$_url_map.'">Map</fb:action>';
}
if ($member!=false) {
	echo '<fb:action href="'.$appcallbackurl.'edit.php">My Settings</fb:action>';
	echo '<fb:action href="'.$appcallbackurl.'?club='.$member['club_id'].'">My Club</fb:action>';
	echo '<fb:action href="'.$appcallbackurl.'invite.php">Invite</fb:action>';
}
if ($is_app_added==false) {
	echo '<fb:action href="http://www.facebook.com/add.php?api_key='.$appapikey.'&ref=nf">Add this Application</fb:action>';
}	
echo '<fb:help href="http://www.facebook.com/board.php?uid=2428422209" title="Need help">Help</fb:help>';
if ($is_app_added==true && $member==false) {
	echo '<fb:create-button href="'.$appcallbackurl.'add.php">Member Sign Up</fb:create-button>';
}
echo '</fb:dashboard>';

// Messages - New Member

if ($_REQUEST['selected_club']==1) {
	echo '<fb:explanation message="Club Membership Selected">Thanks for selecting your club membership!<br> You can change your membership details including club position in the "<a href="'.$appcallbackurl.'edit.php">My Settings</a>" tab above.</fb:explanation><br>';
} elseif ($_REQUEST['added_club']==1) {
	echo '<fb:explanation message="Club Added Successfully">You have successfully added a new '.$_ClubName.' Club and become a member of it.<br> You can change your membership details including club position in the "<a href="'.$appcallbackurl.'edit.php">My Settings</a>" tab above.</fb:explanation><br>';
}
	
	
	
// Country Selector

echo '<form action="?do-it" method="get">';
echo '<div style="background: #d8dfea; border-top: 1px solid #CFD7E4; border-bottom: 1px solid #CFD7E4; padding: 5px 10px 5px 20px">';
echo '<select name="country">';
echo '<option value="0">please select country ...</option>';
echo dropdown(countries('inDatabase'), $selected_country_id);
echo '</select>';
echo ' <input type="submit" value="Go" /><br>';
echo '</div>';
echo '</form>';


// Club Selector

if ($club_selector==true) {
	if ($admin==true) {
		echo '<form action="merge.php" method="get">';
	}
	echo '<div style="background: #fff; border-bottom: 1px solid #CFD7E4; margin: -1px 0px 0px 0px; padding: 5px 10px 5px 30px">';
	echo '<br><b>Clubs in '.$GLOBALS[countries][$selected_country_id].'</b><br>';
	echo '<ul compact="compact" type="circle">';
	$sep_city='';
	foreach ($clubs_in_country as $club) {
		// strtolower($club[city]) => so capitilization plays no role
		if ($sep_city=='') {
			$sep_city=strtolower($club[city]);
			echo "\t".'<b>'.$club[city].'</b>'."\n";
		}
		if ($sep_city==strtolower($club[city])) {
		} else {
			$sep_city=strtolower($club[city]);
			echo "\t".'<br><b>'.$club[city].'</b>'."\n";
		}
		if ($club[id]==$selected_club_id) {
			echo "\t".'<li>'.$club[name].'</li>'."\n";
		} else {
			$club_str = '<a href="'.$appcallbackurl.'?club='.$club[id].'">'.$club[name].'</a>';
    		echo "\t".'<li>';
			if ($admin==true) {
				echo '<input id="clubs" name="clubs[]" value="'.$club[id].'" type="checkbox"/><label for="clubs" id="label_clubs">';
				echo $club_str;
				echo '</label>';
			} else {
				echo $club_str;
			}
 				echo '</li>'."\n";
		}
	}
	echo '</ul>';
	if ($admin==true) {
		echo '<input name="merge" type="submit" value="merge clubs">';
		echo '</form>';
	}
	echo '</div>';
}


// Dialog - Add Event

// <a href="#" clicktoshowdialog="addevent_dialog">Add New Event</a>
if ($member!=false) {
	function create_events_dropdown($array, $select_group_id=false) {
		foreach($array as $i => $it) {
			$r .= "\t".'<option value="'.$it[eid].'"'.selected($it[eid], $select_group_id).'>'.$it[name].'</option>'."\n";
		}
		return $r;
	}
	$my_events_arr = $facebook->api_client->fql_query("SELECT eid, name, tagline, nid, pic, pic_big, pic_small, host, description, event_type, event_subtype, start_time, end_time, creator, update_time, location, venue FROM event WHERE eid IN (SELECT eid FROM event_member WHERE uid='$user' AND rsvp_status='attending') AND start_time>now()");
    echo '<fb:dialog id="addevent_dialog" cancel_button=1><fb:dialog-title>Add a '.$_ClubName.' Event</fb:dialog-title><fb:dialog-content><form id="addevent_form">After <a href="http://www.facebook.com/editevent.php">creating an Event</a><select name="eventid"><option value="0">select it here</option>';
	echo create_events_dropdown($my_events_arr);
	echo '</select> <br><br>and certify that it is hosted by '.$_ClubName.' <select name="eventhosttype"><option value="1">'.$member['club_name'].'</option>';
	if ($member['club_district']!=0) {
		echo '<option value="2">District '.$member['club_district'].'</option>';
	}
	echo '<option value="3">'.$GLOBALS[countries][$member['club_country']].'</option></select></form></fb:dialog-content><fb:dialog-button type="submit" value="Save" form_id="addevent_form" /></fb:dialog>';  
}


// !club  
    
if ($selected_club_id==false) { 
	if ($is_app_added==false) {
		if ($_REQUEST['confirm_invite']==1) {
			echo '<fb:redirect url="'.$appcallbackurl.'add.php">';
		} else {
			echo '<br><fb:explanation message="Are you interested in '.$_ClubName.' or a '.$_ClubName.' Club Member?">Then you might want to <a href="http://www.facebook.com/add.php?api_key='.$appapikey.'&ref=nf">add the application</a> to stay informed about clubs and events in your region. <a href="http://www.facebook.com/add.php?api_key='.$appapikey.'&ref=nf">Let\'s go!</a></fb:explanation>';
		}
	} elseif ($is_app_added==true && $member==false) {
		// confirm_invite needed?
		echo '<br><fb:explanation message="Are you a '.$_ClubName.' Club Member?">Help us grow by entering <a href="'.$appcallbackurl.'add.php">your membership details</a>.</fb:explanation>';
	}
    	
	
	
	// Database Statistics / Chart
	
	function get_num_clubs() {
		$query = 'SELECT * FROM clubs';
		$result = mysql_query($query) or die();
		$club_number = mysql_num_rows($result);
		mysql_free_result($result);
		return $club_number;
	}
	// $GLOBALS[country_number];
	$percentage_countries = round(($GLOBALS[country_number]/$_stats_countries)*100);
	$pc_rest = 100-$percentage_countries;
    	
	$club_number = get_num_clubs();
	$percentage_clubs = round(($club_number/$_stats_clubs)*100);
	$pcl_rest = 100-$percentage_clubs;
    	
	echo '<div style="background: #fff; border-top: 1px solid #CFD7E4; border-bottom: 1px solid #CFD7E4; margin: 15px 10px 5px 10px;  padding: 5px 10px 5px 10px">';
	echo '<b>Current Directory Statistics (<a href="'.$appcallbackurl.'invite.php">Help us grow!</a>)</b>';
	echo '<table border="0" cellspacing="3" cellpadding="0"><tr><td><table width="100" border="0" cellspacing="0" cellpadding="0"><tr bgcolor="#e0e0e0"><td width="'.$percentage_countries.'%" bgcolor="#99FF00">&nbsp;</td><td width="'.$pc_rest.'%">&nbsp;</td></tr></table></td><td valign="middle">'.$GLOBALS[country_number].' of '.$_stats_countries.' '.$_ClubName.' Countries represented!</td></td></tr><tr><td><table width="100" border="0" cellspacing="0" cellpadding="0"><tr bgcolor="#e0e0e0"><td width="'.$percentage_clubs.'%" bgcolor="#99FF00">&nbsp;</td><td width="'.$pcl_rest.'%">&nbsp;</td></tr></table></td><td>'.$club_number.' of '.$_stats_clubs.' '.$_ClubName.' Clubs represented!</td></tr></table>';
	echo '</div>';
    	
    
    
    // Upcoming Events
    
	echo '<div style="background: #fff; margin: 5px 10px 5px 10px;  padding: 5px 10px 5px 10px">';
	echo '<br><b>Upcoming Events</b>';
 	if ($selected_club_id==false && $selected_country_id==false) {
		echo ' in your <font color="#FF0000">Country</font>, <font color="#FF9900">District</font> and <font color="#33FF00">Club</font>';
	} else {
		echo ' in this <font color="#FF0000">Country</font> and <font color="#FF9900">District</font>';
	}
	if ($member!=false) { 
		echo ' (<a href="#" clicktoshowdialog="addevent_dialog">Add Event</a>)';
	}
    		
	if ($upcoming_events==true) {
    		
	foreach ($upcoming_events as $event => $event_type) {
		if ($e_id_str!='') { $e_id_str .= ', '; }
			$e_id_str .= $event;
		}
		if ($is_logged_out==true) {
			echo '<br><a href="https://login.facebook.com/login.php">Log in</a> to see Upcoming Events!';
			// otherwise api error - 'Session key invalid or no longer valid'
		} else {
			$upcoming_events_arr = $facebook->api_client->fql_query("SELECT eid, name, tagline, nid, pic, pic_big, pic_small, host, description, event_type, event_subtype, start_time, end_time, creator, update_time, location, venue FROM event WHERE eid in ($e_id_str)");
		
			echo '<div style="background: #fff; margin: 5px 0px 5px 0px;  border: 1px solid #d8dfea; padding: 7px 7px 7px 7px; position: relative;">';
			foreach ($upcoming_events_arr as $event) {
				if ($upcoming_events[$event[eid]]==1) {
					echo '<font color="#33FF00">Club</font>';
				} elseif ($upcoming_events[$event[eid]]==2) {
					echo '<font color="#FF9900">District</font>';
				} elseif ($upcoming_events[$event[eid]]==3) {
					echo '<font color="#FF0000">Country</font>';
				}
				echo ':&nbsp;&nbsp;<a href="http://www.facebook.com/event.php?eid='.$event[eid].'">'.$event[name].'</a> ['.date('F j, g:ia', 	$event[start_time]).']<br>';
			}
			echo '</div>';
		}
	} 
	echo '</div>';
} else { 
	echo '<br>';
}	
	
    
    
// configure message txt
$msg='';
$subj=$_ClubName;
    

// Club

if ($members==true) {

	// club data
	echo '<div style="background: #fff; margin: 5px 20px 5px 20px;">';
	echo '<a href="'.$appcallbackurl.'?country='.$selected_country_id.'">'.$GLOBALS[countries][$selected_country_id].'</a> &gt;<br><big> '.$_ClubName.' Club of <b>'.$club_data[name].'</b></big>'; 
	echo '<br><br><b>Details</b>';
	if ($my_club==true || $admin==true) {
		echo ' (<a href="'.$appcallbackurl.'editclub.php?club='.$selected_club_id.'">Edit</a>)';
	}
	echo '<br><div style="background: #fff; margin: 5px 0px 5px 0px;   border: 1px solid #d8dfea; padding: 7px 7px 7px 7px; position: relative;">';
	
	if ($club_data[district]!=0) {
		echo 'District: '.$club_data[district].'<br>';
	}
	$map_string=urlencode($club_data[city].', '.$GLOBALS[countries][$club_data[country]]);
	echo ''.$club_data[city].', '; // city
	echo $GLOBALS[countries][$club_data[country]].' (<a href="http://maps.google.com/maps?q='.$map_string.'" target="_blank">map</a>)'; // country
	if ($club_data[url]!='' || $club_data[fb_groupid]!=0) {
		echo '<br />';
	}
	if ($club_data[url]!='') {
		echo '<br /><a href="'.$club_data[url].'" target="_blank">Homepage</a>';
	}
	if ($club_data[fb_groupid]!=0) {
		echo '<br /><a href="http://www.facebook.com/group.php?gid='.$club_data[fb_groupid].'">Group</a>';
	}
	echo '</div>';
	
	
	// Club Events
	
	echo '<br><b>Events</b>';
	if ($my_club==true) { 
		echo ' (<a href="#" clicktoshowdialog="addevent_dialog">Add Event</a>)';
	}
	if ($upcoming_events==true) {
		foreach ($upcoming_events as $event => $event_type) {
			if ($e_id_str!='') { $e_id_str .= ', '; }
				$e_id_str .= $event;
		}
		$upcoming_events_arr = $facebook->api_client->fql_query("SELECT eid, name, tagline, nid, pic, pic_big, pic_small, host, description, event_type, event_subtype, start_time, end_time, creator, update_time, location, venue FROM event WHERE eid in ($e_id_str)");
    		
		if (!empty($upcoming_events_arr)) {
			echo '<div style="background: #fff; margin: 5px 0px 5px 0px;  border: 1px solid #d8dfea; padding: 7px 7px 7px 7px; position: relative;">';
			foreach ($upcoming_events_arr as $event) {
				echo '<a href="http://www.facebook.com/event.php?eid='.$event[eid].'">'.$event[name].'</a> ['.date('F j, g:ia', 	$event[start_time]).']<br>';
			}
			echo '</div>';
		} else {
			echo '<br>';
		}
	} else {
		echo '<br>';
	}
    	
    	
    	
    // club members
    
    echo '<br><b>Members</b>';
	if ($my_club==true) {
		echo ' (<a href="'.$appcallbackurl.'invite.php">Invite a Friend</a>)';
	}
    	
	foreach ($members as $m) {
		//echo '<fb:if-can-see uid="'.$member[0].'">';
		echo '<div style="background: #fff; margin: 5px 0px 5px 0px;  border: 1px solid #d8dfea; padding: 5px 5px 5px 5px; position: relative;">';
		echo '<table><tr><td align="left" valign="middle">';
		echo '<fb:profile-pic uid="'.$m[fb_id].'" size="q" linked="false" />';
		echo '</td><td width="80%" align="left" valign="middle">';
		echo '<div style="margin: 0px 0px 0px 5px;">';
		echo '<fb:if-is-friends-with-viewer uid="'.$m[fb_id].'">';
		echo '<fb:name uid="'.$m[fb_id].'" shownetwork="true" linked="true" useyou="false" />';
		echo '<fb:else><fb:name uid="'.$m[fb_id].'" shownetwork="true" linked="false" useyou="false" /></fb:else>';
		echo '</fb:if-is-friends-with-viewer>';
		echo '<br><small>'.$GLOBALS[positions_arr][$m[position]].'</small>'; 
		echo '</div>';
		echo '</td><td width="20%" align="left" valign="middle" nowrap="nowrap">';
		echo '<fb:if-is-user uid="'.$m[fb_id].'"><fb:else><small><a href="http://www.facebook.com/message.php?id='.$m[fb_id].'&subject='.$subj.'&msg='.$msg.'">Send Message</a></small><br /></fb:else></fb:if-is-user>';
		echo '<fb:if-is-user uid="'.$m[fb_id].'"><small><a href="'.$appcallbackurl.'edit.php">Edit</a></small><fb:else><fb:if-is-friends-with-viewer uid="'.$m[fb_id].'"><small><font color="#33FF00">Friend</font></small><fb:else><small><a href="http://www.facebook.com/addfriend.php?id='.$m[fb_id].'">Add to Friends</a></small><br /></fb:else> </fb:if-is-friends-with-viewer></fb:else></fb:if-is-user>';
		if ($my_club==true) {
			if ($m[fb_id]!=$user && $m[position]!='10') {
				echo '<fb:if-is-friends-with-viewer uid="'.$m[fb_id].'"> <fb:else><small><a href="'.$appcallbackurl.'report_user.php?id='.$m[fb_id].'"><font color="#CC0000">Report as Fake Member</font></a></small><br /></fb:else></fb:if-is-friends-with-viewer>';
			}
		}
		echo '</td></tr></table>';
		echo '</div>';
		echo '</fb:if-can-see>';
	}
	echo '</div>';
}
    
    
	
	
	 
    
	
// newest members

if ($newest_members==true) {
	echo '<div style="background: #fff; margin: 5px 10px 5px 10px; border: 0px solid #d8dfea; padding: 5px 10px 5px 10px">';
	echo '<b>Newest Members';
	if ($selected_country_id!=false && $selected_club_id==false) {
		echo ' in '.$GLOBALS[countries][$selected_country_id];
	}
	echo '</b>';
    
	if ($newest_members!=false) {
		echo '<br>';
		foreach ($newest_members as $m) {
			echo '<div style="background: #fff; margin: 5px 0px 5px 0px;  border: 1px solid #d8dfea; padding: 5px 5px 5px 5px; position: relative;">';
			echo '<table><tr><td align="left" valign="middle">';
			echo '<fb:profile-pic uid="'.$m[fb_id].'" size="q" linked="false" />';
			echo '</td><td width="80%" align="left" valign="middle">';
			echo '<div style="margin: 0px 0px 0px 5px;">';
    			
			echo '<fb:if-is-friends-with-viewer uid="'.$m[fb_id].'">';
			echo '<fb:name uid="'.$m[fb_id].'" shownetwork="true" linked="true" useyou="false" />';
			echo '<fb:else><fb:name uid="'.$m[fb_id].'" shownetwork="true" linked="false" useyou="false" /></fb:else>';
			echo '</fb:if-is-friends-with-viewer>';
				
			echo '<br><small>'.$GLOBALS[positions_arr][$m[position]].' of the '.$_ClubName.' Club of <a href="'.$appcallbackurl.'?club='.$m[club_id].'">'.$m[club_name].'</a><br>';
			echo ''.$m[club_city].', ';
			echo '<a href="'.$appcallbackurl.'?country='.$m[club_country].'">'.$GLOBALS[countries][$m[club_country]].'</a></small>'; // country
			echo '</div>';
    			
			echo '</td><td width="20%" align="left" valign="middle" nowrap="nowrap">';
			echo '<fb:if-is-user uid="'.$m[fb_id].'"><fb:else><small><a href="http://www.facebook.com/message.php?id='.$m[fb_id].'&subject='.$subj.'&msg='.$msg.'">Send Message</a></small><br /></fb:else></fb:if-is-user>';
			
			echo '<fb:if-is-user uid="'.$m[fb_id].'"><small><a href="'.$appcallbackurl.'edit.php">Edit</a></small><fb:else><fb:if-is-friends-with-viewer uid="'.$m[fb_id].'"><small><font color="#33FF00">Friend</font></small><fb:else><small><a href="http://www.facebook.com/addfriend.php?id='.$m[fb_id].'">Add to Friends</a></small><br /></fb:else> </fb:if-is-friends-with-viewer></fb:else></fb:if-is-user>';
    			
			if ($my_club==true) {
				if ($m[fb_id]!=$user && $m[position]!='10') {
					echo '<fb:if-is-friends-with-viewer uid="'.$m[fb_id].'"> <fb:else><small><a href="'.$appcallbackurl.'report_user.php?id='.$m[fb_id].'"><font color="#CC0000">Report as Fake Member</font></a></small><br /></fb:else></fb:if-is-friends-with-viewer>';
				}
			}
			
			echo '</td></tr></table>';
			echo '</div>';
			echo '</fb:if-can-see>';
		}
	}
    	echo '</div>';
}

mysql_close($link);


?>
<div style="background: #fff; margin: 15px 10px 15px 20px;">This Application is <b>Open Source</b>. Check out the <a href="http://code.google.com/p/open-club-directory/">Developer Site</a> and start contributing.<br></div>

<fb:google-analytics uacct="<?php echo $_google_analytics_account; ?>" />